package cn.shentianlan.mapper;

import cn.shentianlan.criteria.CourseSchedulingCriteria;
import cn.shentianlan.domain.dto.CourseSchedulingBatchSaveDTO;
import cn.shentianlan.domain.dto.CourseSchedulingExportVO;
import cn.shentianlan.domain.dto.CourseSchedulingListVO;
import cn.shentianlan.domain.entity.CourseScheduling;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

/**
 * @Author 陈俊源
 * @Description TODO
 * @Date 2021/5/1
 * @Version 1.0
 */
@Repository
public interface CourseSchedulingMapper {


    /**
     * 根据课室id查询排课信息
     * @return
     */
    List<CourseSchedulingListVO>  selectCourseSchedulingListByClassroomId(Map<String, Object> args);

    /**
     * 根据教师id查询排课信息
     * @param args
     * @return
     */
    List<CourseSchedulingListVO> selectCourseSchedulingListByTeacherId(Map<String, Object> args);

    /**
     * 保存排课信息
     * @param courseScheduling
     */
    void save(CourseScheduling courseScheduling);

    /**
     * 根据过滤条件查询排课信息
     * @param courseSchedulingCriteria
     * @return
     */
    List<CourseSchedulingListVO> selectCourseSchedulingList(CourseSchedulingCriteria courseSchedulingCriteria);

    /**
     * 根据过滤条件查询课程数量
     * @param courseSchedulingCriteria
     * @return
     */
    List<Map<String, Object>> selectCourseSchedulingCourseCount(CourseSchedulingCriteria courseSchedulingCriteria);

    /**
     * 根据id获取相应排课信息
     * @param id
     * @return
     */
    CourseSchedulingListVO getCourseSchedulingById(Long id);

    /**
     * 更新排课信息
     * @param courseScheduling
     */
    void update(CourseScheduling courseScheduling);

    /**
     * 检测课室冲突
     * @param args
     * @return
     */
    List<CourseSchedulingListVO> selectCourseSchedulingListByCheck(Map<String, Object> args);

    void deleteCourseSchedulingById(Long id);

    List<String> selectTimePeriodByDateRange(@Param("dateList") List<LocalDate> value,@Param("classroomId") Long classroomId);

    List<CourseSchedulingExportVO> selectByDateRange(@Param("startDate") LocalDate startDate,@Param("endDate") LocalDate endDate,@Param("classroomId") Long classroomId);
}
